import { prop, modelOptions, mongoose } from '@typegoose/typegoose';
import { ApiProperty } from '@nestjs/swagger';
import { Base, TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
// 给添加的数据加入时间戳
@modelOptions({
  schemaOptions: {
    timestamps: true,
  },
})
export class Workspace extends TimeStamps {
  _id: mongoose.Types.ObjectId;
  id: string;

  @ApiProperty({ description: '工作区', example: 'nest.js学习区' })
  @prop({
    required: true,
  })
  name: string;

  @ApiProperty({ description: '工作区属于的用户' })
  @prop({
    required: true,
  })
  uid: string;
}
